<?php
class totalStock extends Admin {

    private $tab = array( 'inStock' => '入库管理','inGoodsEit'=>'货品管理');
    private $color = array('深红', '大红','橘红','橘黄 ',
        '玫瑰红','橙色','深黄','淡黄','草绿',
        '墨绿', '柠檬黄', '黄绿', '蓝绿', '浅绿',
        '天蓝', '湖蓝', '黑色', '白色', '紫色',
        '红灰', '黄灰', '蓝灰', '紫灰', '浅灰');
    private $size = array('080CM','085CM','090CM','095CM','100CM',"105CM","110CM",
        "115CM","120CM","125CM","130CM","135CM","140CM","145CM","150CM","155CM","160CM");

    public function __construct() {
        parent::__construct();
        $this->pk = "inOutStockNo";
    }

    public function index( $c, $a ) {

        include $this->display( $c );
    }
public function lookTotalStock($c,$a)
{
        $res['inOutStockType'] = G('inOutStockType');
        $res['inOutStockNo'] = G('inOutStockNo');

        $this->table = 'inOutStock';
        $this->pk = 'inOutStockNo';
        $res1 = $this->find(array('inOutStock'=>$res['inOutStockNo']),null,'inOutRecList');


        $sql = "SELECT goodsNo,color,size, SUM(goodsNumber) as goodsNumber FROM xbl_inoutstockrec  where  inOutStockNo =  ". $res['inOutStockNo']." and inOutStyle = ".$res['inOutStockType']." GROUP BY  goodsNo,color,size" ;
        $result = $this->Paged()->findSql($sql);

       // print_r($sql);
  //  print_r($result);
        $pager = $result['page'];
        $result = $result['result'];

    foreach($result as $key=>$val)
    {
        $result[$key]['color'] = $this->color[$val['color']];
        $result[$key]['size'] = $this->size[$val['size']];
    }

        include $this->display( $c );
}


}


